<?php
/**
 * licenses : MIT
 * creatTime: 2020/5/13
 * author : weblinuxgame
 * filename: UserApi.php
 */

namespace App\Api\Modules\User;

use Illuminate\Http\Request;
use Illuminate\Http\Response;
use OpenApi\Annotations as OA;

/**
 * @OA\Tag(
 *     name="Auth",
 *     description="## 前端-认证接口集合"
 * )
 *
 * Interface AuthApi
 * @package App\Api\Modules\User
 */
interface AuthApi
{
    /**
     * @OA\Post(
     *     path="/login",
     *     tags={"Auth"},
     *     summary="user login",
     *     description="app用户登陆",
     *     operationId="userLogin",
     *     @OA\RequestBody(
     *       description="用户登陆请求",
     *       @OA\JsonContent(ref="#/components/schemas/UserLoginRequest"),
     *     ),
     *     @OA\Parameter(
     *       name="X-AppVer",
     *       in="header",
     *       description="app version,eg:2.0.0 ",
     *       @OA\Schema(
     *          type="string",
     *          format="string",
     *          default="0.0.1",
     *       ),
     *     ),
     *     @OA\Response(
     *         response="default",
     *         description="successful operation",
     *         @OA\JsonContent(ref="#/components/schemas/LoginSuccessResponse"),
     *     ),
     * )
     */

    /**
     * 用户登陆接口
     * @param Request $request
     * @return Response
     */
    public function login(Request $request): Response;

    /**
     * @OA\Delete(
     *     path="/logout",
     *     tags={"Auth"},
     *     summary="admin user logout",
     *     description="仅用于app用户退登",
     *     operationId="userLogout",
     *      @OA\Parameter(
     *          name="Authentication",
     *          in="header",
     *          description="退出登陆,仅需要身份临牌",
     *          @OA\Schema(
     *              type="string",
     *              format="string",
     *              example="94a08da1fecbb6e8b46990538c7b50b2"
     *          )
     *     ),
     *     @OA\Parameter(
     *       name="X-AppVer",
     *       in="header",
     *       description="app version,eg:2.0.0 ",
     *       @OA\Schema(
     *          type="string",
     *          format="string",
     *          default="0.0.1",
     *       ),
     *     ),
     *     @OA\Response(
     *         response="default",
     *         description="请求结果",
     *        @OA\JsonContent(
     *           type="object",
     *           @OA\Items(ref="#/components/schemas/ApiResponse"),
     *           examples={
     *              "退出成功":{  "value": {"code":200,"message":"ok","data":null } },
     *              "退出失败":{  "value": {"code":0,"message":"failed","data":null} },
     *           }
     *       ),
     *     ),
     *  )
     */
    /**
     * 退出
     * @param Request $request
     * @return Response
     */
    public function logout(Request $request): Response;

}
